{include file="header.html"} 
<script type="text/javascript">
$(function(){
    $('#find_password_form').validate({
        errorPlacement: function(error, element){
            var error_td = element.parent('dd');
			error_td.find('i').removeClass('ok');
            error_td.find('label').hide();
            error_td.append(error);
        },
        success       : function(label){
			label.siblings('i').addClass('ok');
            label.remove();
        },
		submitHandler: function(form) {
			if($('input[name="codeType"').val() != '' && $('input[name="code"]').val() != '') {
				form.submit();
			} else {
				var user_name = $.trim($('input[name="user_name"]').val());
   				ajax_form('find_password', '{$lang.captcha}', REAL_SITE_URL + '/index.php?app=gselector&act=captcha&dialog=1&title={$lang.captcha}&id=find_password&user_name='+user_name, '300', 'simple-blue', '0.05');
        		return false;
			}
 		},
        onkeyup: false,
        rules : {
            user_name : {
                required : true
            },
            captcha : {
                required : true,
                remote   : {
                    url : 'index.php?app=captcha&act=check_captcha',
                    type: 'get',
                    data:{
                        captcha : function(){
                            return $('#captcha1').val();
                        }
                    }
                }
            } 
        },
        messages : {
            user_name : {
                required : '{$lang.username_required}'
            },
            captcha : {
                required : '{$lang.captcha_required}',
                remote   : '{$lang.captcha_error}'
            }
        }
    });
});
function gs_callback(id, codeType, code)
{
	$('input[name="codeType"]').val(codeType);
	$('input[name="code"]').val(code);
	DialogManager.close(id);
	$('#find_password_form').submit();
}
</script>
<div id="main" class="w-full">
	<div id="page-find-password" class="w-full page-auth mt20 mb20">
		<div class="wrap">
			<div class="form clearfix">
				<form id="find_password_form" method="post">
					<div class="clearfix">
						<dl class="clearfix">
							<!--<dt>&nbsp;</dt>-->
							<dd class="clearfix">
								<input type="text" class="input" name="user_name" placeholder="{$lang.your_username}" />
								<i class="i-name"></i> </dd>
						</dl>
						<dl class="clearfix">
							<dt>&nbsp;</dt>
							<dd class="captcha clearfix">
								<input type="text" class="input float-left" name="captcha"  id="captcha1" placeholder="{$lang.captcha}" />
								<p class="float-left" style="width:57%; height:54px;"><a href="javascript:change_captcha($('#captcha'));"><img height="26" id="captcha" src="index.php?app=captcha&amp;{$random_number}" /></a></p>
							</dd>
						</dl>
						<dl class="clearfix">
							<dt>&nbsp;</dt>
							<dd>
								<input type="hidden" name="codeType" value="" />
								<input type="hidden" name="code" value="" />
								<input type="submit" value="{$lang.submit}" class="btn-alipay" title="{$lang.find_password}" />
							</dd>
						</dl>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
{include file="footer.html"}